import React from "react";
import {Button, Icon, InputItem, NavBar} from "antd-mobile";
import "../../Style/fund.css";

const isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let moneyKeyboardWrapProps;
if (isIPhone) {
    moneyKeyboardWrapProps = {
        onTouchStart: e => e.preventDefault(),
    };
};

export default class Fund_buy_pass extends React.Component{
    state = {
        type: 'money',
    };

    render() {
        const { type } = this.state;
        return(
            <div>
                <NavBar className="f_r_nav"
                        mode="light"
                        leftContent={[
                            <Icon type="left" />,
                            "返回",
                        ]}
                        onLeftClick={() => {this.props.history.push('/terran/fundrank')}}
                >
                    请输入支付密码
                </NavBar>
                <div style={{width:'100%',margin:'50px 0 0 0',padding:'0 0 0 20px'}}>
                    <p style={{width:'100%',height:'40px',lineHeight:'40px',fontSize:'18px',margin:'0',padding:'0'}}>请输入支付密码</p>
                    <InputItem
                        type={type}
                        placeholder="请输入支付密码(功能完善中，请随性输入)"
                        clear
                        moneyKeyboardAlign="left"
                        moneyKeyboardWrapProps={moneyKeyboardWrapProps}
                        className="input_buy_money">支付密码</InputItem>
                </div>
                <div style={{width:'100%',height:'15px',background:'rgb(245,245,247)'}}></div>
                <Button type={"primary"} className="botton_buy_fund" style={{position:'relative'}}
                        onClick={() => {
                            window.location.href = '#/terran/fundbuyresult'
                        }}>
                    <p>确定</p>
                </Button>
            </div>
        );
    };
};